
ROOTDIR = ../..
include $(ROOTDIR)/Rules.make

CC = arm-none-linux-gnueabi-gcc
STRIP = arm-none-linux-gnueabi-strip
RM = /bin/rm -f

FFMPEG=$(shell pwd)/ffmpeg

CFLAGS = $(OPTIM) -Wall -I$(FFMPEG)
LD_FLAGS =
LIBS = -L$(LINUXLIBS_INSTALL_DIR)/lib -lpthread -lm -lpthread -lasound -lticodec $(FFMPEG)/libavformat.a $(FFMPEG)/libavcodec.a $(FFMPEG)/libavdevice.a $(FFMPEG)/libavutil.a
OPTIM =
MKDIR = /bin/mkdir

OBJDIR = build

OBJS = $(OBJDIR)/main.o \
	$(OBJDIR)/av_streamer.o \
	$(OBJDIR)/av_capture.o \
	$(OBJDIR)/av_encode.o

TARGET = dvs

$(OBJDIR)/%.o: %.c
	@if [ ! -d $(OBJDIR) ]; \
	then $(MKDIR) $(OBJDIR); \
	fi
	$(CC) $(CFLAGS) -c $< -o $@

all: $(OBJS)
	$(CC) $(LD_FLAGS) -o $(TARGET) $(OBJS) $(LIBS)
	$(STRIP) $(TARGET)

clean:
	$(RM) -r $(OBJDIR)
	$(RM) $(TARGET)